package forms;

import java.util.Date;

import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;

import org.springframework.format.annotation.DateTimeFormat;

import domain.Auction;
import domain.Money;

public class BidForm {
	
	//Constructor
		public BidForm(){
			super();
		}
		
		//Attributes
		
		private Date date;
		private Money amount;
		
		private int bidId;
		private Auction auction;
		
		
		@NotNull
		@Past
		@Temporal(TemporalType.TIMESTAMP)
		@DateTimeFormat(pattern = "dd/MM/yyyy HH:mm")
		public Date getDate() {
			return date;
		}

		public void setDate(Date date) {
			this.date = date;
		}
		
		@Valid
		@NotNull
		public Money getAmount() {
			return amount;
		}

		public void setAmount(Money amount) {
			this.amount = amount;
		}
		public int getBidId() {
			return bidId;
		}
		public void setBidId(int bidId) {
			this.bidId = bidId;
		}
		
		public Auction getAuction() {
			return auction;
		}
		public void setAuction(Auction auction) {
			this.auction = auction;
		}

}
